package a.e.a;

import a.d.u;
import a.i.ib;
import a.i.jb;
import a.j.a.o;
import a.j.c;
import a.j.*;

import java.io.Externalizable;
import java.io.IOException;
import java.util.Iterator;
import java.util.Set;

public class gb
  implements hb
{
  public static int a;
  
  public void a(Object paramObject, g paramg)
    throws IOException
  {
    boolean bool = r.f;
    int i = r.e;
    ld localld = (ld)paramObject;
    paramg.a("x", localld.A());
    paramg.a("y", localld.B());
    paramg.a("w", localld.c());
    paramg.a("h", localld.d());
    String str = "rectangle";
    if (!bool) {
      if ((localld instanceof od))
      {
        localObject1 = (od)localld;
        str = a(((od)localObject1).U());
        paramg.b("type", str);
        if (bool) {
          break label889;
        }
        if (((od)localObject1).V() == null) {
          break label885;
        }
        if (!bool)
        {
          if (((od)localObject1).X() == 0)
          {
            if (bool) {
              break label886;
            }
            if (((od)localObject1).W() == 0) {
              break label885;
            }
          }
          paramg.b("dropShadowColor", a.e.f.a(((od)localObject1).V()));
          paramg.a("dropShadowOffsetX", ((od)localObject1).X());
          paramg.a("dropShadowOffsetY", ((od)localObject1).W());
        }
        if ((!bool) && (i == 0)) {
          break label885;
        }
      }
    }
    if (!bool) {
      if ((localld instanceof nd))
      {
        localObject1 = (nd)localld;
        if (bool) {
          break label886;
        }
        if (((nd)localObject1).i() == null) {
          break label885;
        }
        paramg.b("image", ((nd)localObject1).i().toString());
        if (bool) {
          break label886;
        }
        if (!((nd)localObject1).e()) {
          break label885;
        }
        paramg.a("alphaImage", true);
        if (!bool) {
          if (i == 0) {
            break label885;
          }
        }
      }
      else
      {
        if (bool) {
          break label886;
        }
      }
    }
    label387:
    Object localObject4;
    Object localObject5;
    if ((localld instanceof md))
    {
      localObject1 = (md)localld;
      paramg.b("customconfiguration", ((md)localObject1).g());
      Object localObject2;
      if (!bool)
      {
        if ((localld instanceof a.j.a.n))
        {
          localObject2 = (a.j.a.n)localld;
          paramg.a("group", true);
          paramg.a("autoResize", ((a.j.a.n)localObject2).U());
          if (!bool) {
            if (((a.j.a.n)localObject2).h())
            {
              paramg.a("closedHeight", ((a.j.a.n)localObject2).d());
              paramg.a("closedWidth", ((a.j.a.n)localObject2).c());
              if (!bool) {
                if (i == 0) {
                  break label387;
                }
              }
            }
            else
            {
              paramg.a("closedHeight", ((a.j.a.n)localObject2).X());
            }
          }
          paramg.a("closedWidth", ((a.j.a.n)localObject2).W());
          localObject4 = ((a.j.a.n)localObject2).j();
          if (!bool) {
            if (localObject4 != null)
            {
              paramg.a("borderInsetBottom", ((u)localObject4).d);
              paramg.a("borderInsetLeft", ((u)localObject4).c);
              paramg.a("borderInsetTop", ((u)localObject4).b);
              paramg.a("borderInsetRight", ((u)localObject4).e);
            }
          }
          localObject5 = ((a.j.a.n)localObject2).i();
          if (!bool)
          {
            if (localObject5 != null)
            {
              paramg.a("minimalInsetBottom", ((u)localObject5).d);
              paramg.a("minimalInsetLeft", ((u)localObject5).c);
              paramg.a("minimalInsetTop", ((u)localObject5).b);
            }
          }
          else {
            paramg.a("minimalInsetRight", ((u)localObject5).e);
          }
          paramg.a("closed", ((a.j.a.n)localObject2).h());
        }
        if (bool) {}
      }
      else if (((md)localObject1).l() != null)
      {
        try
        {
          localObject2 = ib.c().a(((md)localObject1).l(), ((md)localObject1).l().getClass());
          paramg.b("userdataclass", ((md)localObject1).l().getClass().getName());
          paramg.b("userdata", (String)localObject2);
        }
        catch (Exception localException)
        {
          a.i.n.a("Could not write userdata " + ((md)localObject1).l() + " " + localException);
        }
      }
      if (bool) {
        break label886;
      }
      localObject3 = ((md)localObject1).f();
      if (((Set)localObject3).size() > 0)
      {
        paramg.a("styleproperties");
        localObject4 = ((Set)localObject3).iterator();
        if (((Iterator)localObject4).hasNext()) {
          paramg.a("property");
        }
        label867:
        label873:
        while (bool)
        {
          localObject5 = (Map.Entry)((Iterator)localObject4).next();
          if (!bool)
          {
            paramg.b("name", (String)((Map.Entry)localObject5).getKey());
            if (i != 0) {
              break label885;
            }
          }
          if ((bool) || (((Map.Entry)localObject5).getValue() != null))
          {
            Object localObject6 = ((Map.Entry)localObject5).getValue();
            jb localjb = ib.c().b(localObject6.getClass());
            if (!bool) {
              if (localjb != null)
              {
                paramg.b("valueClass", localObject6.getClass().getName());
                paramg.b("value", localjb.a(localObject6, localObject6.getClass()));
                if (bool) {
                  break label873;
                }
                if (i == 0) {
                  break label867;
                }
              }
            }
            if (!bool)
            {
              if ((localObject6 instanceof Externalizable)) {
                paramg.b("binaryValue", kb.a().a(localObject6, localObject6.getClass()));
              }
            }
            else
            {
              if (bool) {
                break label873;
              }
              if (i == 0) {
                break label867;
              }
            }
            a.i.n.a("Could not write style properties " + localObject6);
          }
          paramg.b();
          if (i == 0) {
            break;
          }
        }
        paramg.b();
      }
    }
    label885:
    label886:
    if (localld.o() != null)
    {
      label889:
      if (bool) {
        break label918;
      }
      paramg.b("fill", a.e.f.a(localld.o()));
      if (i == 0) {
        break label922;
      }
    }
    label918:
    paramg.a("hasFill", false);
    label922:
    if (!bool) {
      if (localld.p() != null) {
        paramg.b("fill2", a.e.f.a(localld.p()));
      }
    }
    if (localld.q() != null)
    {
      if (bool) {
        break label980;
      }
      paramg.b("outline", a.e.f.a(localld.q()));
      if (i == 0) {
        break label984;
      }
    }
    label980:
    paramg.a("hasOutline", false);
    label984:
    Object localObject1 = localld.r();
    if (!bool) {
      if (((c)localObject1).getLineWidth() != 1.0F) {
        paramg.a("outlineWidth", (int)((c)localObject1).getLineWidth());
      }
    }
    if (((c)localObject1).a() != 0) {
      paramg.b("outlineStyle", e.b(((c)localObject1).a()));
    }
    Object localObject3 = localld;
    if (!bool) {
      if ((localld instanceof qd))
      {
        localObject4 = (qd)localld;
        localObject3 = ((qd)localObject4).i();
      }
    }
    if (!bool) {
      if ((localObject3 instanceof a.j.a.f))
      {
        localObject4 = (a.j.a.f)localObject3;
        localObject5 = ((a.j.a.f)localObject4).j();
        paramg.a("topBorderInset", ((u)localObject5).b);
        paramg.a("bottomBorderInset", ((u)localObject5).d);
        paramg.a("leftBorderInset", ((u)localObject5).c);
        paramg.a("rightBorderInset", ((u)localObject5).e);
      }
    }
    if ((bool) || ((localObject3 instanceof o)))
    {
      localObject4 = (o)localObject3;
      if (((o)localObject4).sb()) {
        paramg.a("considerLabels", ((o)localObject4).sb());
      }
    }
  }
  
  public static String a(byte paramByte)
  {
    switch (paramByte)
    {
    case 0: 
      return "rectangle";
    case 1: 
      return "roundrectangle";
    case 2: 
      return "ellipse";
    case 3: 
      return "parallelogram";
    case 4: 
      return "hexagon";
    case 7: 
      return "octagon";
    case 8: 
      return "diamond";
    case 5: 
      return "triangle";
    case 9: 
      return "trapezoid";
    case 10: 
      return "trapezoid2";
    case 6: 
      return "rectangle3d";
    }
    return "rectangle";
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.a.gb

 * JD-Core Version:    0.7.0.1

 */